using System;
using System.IO;
using System.Reflection;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Resources;
using System.Drawing;
using System.Globalization;

namespace LARS
{
  class ObjectManager
  {
    public Bitmap image;
  
    public void Collect()
    {
      Assembly LarsAssembly = Assembly.GetExecutingAssembly();
    
      Type[] MyTypes = LarsAssembly.GetTypes();
    
      foreach( Type MyType in MyTypes )
      {
        if( MyType.IsSubclassOf( ( typeof( MovingObject ) ) ) )
        {
          try
          {
            MovingObject TempObj = ( ( MovingObject )( Activator.CreateInstance( MyType ) ) );
            
            TempObj.Init();
          }
          catch( Exception Ex )
          {
            MessageBox.Show( Ex.ToString() );
          }
        }
      }

      string[] resources = LarsAssembly.GetManifestResourceNames();
      Stream myStream    = LarsAssembly.GetManifestResourceStream( "LARS.Properties.Sprites.bmp" );
      image              = new Bitmap( myStream );

    }
  }
}
